﻿using Dpy.Math.Geometry.Geometry2D;
using System;
using System.Linq;

namespace MathWpfClient.ViewModels
{
    class PointViewModel : ViewModelBase
    {
        private readonly Vector2D point;
        private readonly double diameter;

        public double X
        {
            get
            {
                return this.point.X - this.Diameter / 2;
            }
        }

        public double Y
        {
            get
            {
                return this.point.Y - this.Diameter / 2;
            }
        }

        public double Diameter
        {
            get
            {
                return this.diameter;
            }
        }

        public PointViewModel(double x, double y, double diameter = 10)
        {
            this.diameter = diameter;
            this.point = new Vector2D(x, y);
        }

        public PointViewModel(Vector2D point, double diameter = 10) : this(point.X, point.Y, diameter) { }
    }
}
